<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    <title>hexo deploy发布失败解决办法 | weiyonghua&#39;s Blog | YOUR_SUBTITLE</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="hexo,deploy">
    <meta name="description" content="问题描述：==ssh秘钥已添加，但没有权限提交==1234567891011121314Error: Host key verification failed.fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exist">
<meta name="keywords" content="hexo,deploy">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo deploy发布失败解决办法">
<meta property="og:url" content="weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/index.html">
<meta property="og:site_name" content="weiyonghua&#39;s Blog">
<meta property="og:description" content="问题描述：==ssh秘钥已添加，但没有权限提交==1234567891011121314Error: Host key verification failed.fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exist">
<meta property="og:image" content="https://static.oschina.net/uploads/img/201610/18115822_miTO.png">
<meta property="og:updated_time" content="2017-05-22T03:09:47.767Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="hexo deploy发布失败解决办法">
<meta name="twitter:description" content="问题描述：==ssh秘钥已添加，但没有权限提交==1234567891011121314Error: Host key verification failed.fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exist">
<meta name="twitter:image" content="https://static.oschina.net/uploads/img/201610/18115822_miTO.png">
    
        <link rel="alternative" href="/atom.xml" title="weiyonghua&#39;s Blog" type="application/atom+xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.4.9">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">weiyonghua</h5>
          <a href="mailto:weiyonghua16@gmail.com" title="weiyonghua16@gmail.com" class="mail">weiyonghua16@gmail.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/1135831485" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://t.qq.com/fy1135831485" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                Weibo
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">hexo deploy发布失败解决办法</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">hexo deploy发布失败解决办法</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-03-03T03:16:00.000Z" itemprop="datePublished" class="page-time">
  2017-03-03
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/FAQ/">FAQ</a></li></ul>

            
        </h5>
    </div>

    

</header>


<div class="container body-wrap">
    
<article id="post-hexo-deploy发布失败解决办法"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">hexo deploy发布失败解决办法</h1>
        <div class="post-meta">
            <time class="post-time" title="2017年03月03日 11:16" datetime="2017-03-03T03:16:00.000Z"  itemprop="datePublished">2017-03-03</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/FAQ/">FAQ</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p><strong>问题描述：</strong><br>==ssh秘钥已添加，但没有权限提交==<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">Error: Host key verification failed.</div><div class="line">fatal: Could not read from remote repository.</div><div class="line"></div><div class="line">Please make sure you have the correct access rights</div><div class="line">and the repository exists.</div><div class="line"></div><div class="line">    at ChildProcess.&lt;anonymous&gt; (D:\WORKSPACES\itblog\node_modules\hexo-util\lib\spawn.js:37:17)</div><div class="line">    at emitTwo (events.js:106:13)</div><div class="line">    at ChildProcess.emit (events.js:191:7)</div><div class="line">    at ChildProcess.cp.emit (D:\WORKSPACES\itblog\node_modules\cross-spawn\lib\enoent.js:40:29)</div><div class="line">    at maybeClose (internal/child_process.js:877:16)</div><div class="line">    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)</div><div class="line">FATAL Host key verification failed.</div><div class="line">fatal: Could not read from remote repository.</div></pre></td></tr></table></figure></p>
<p><strong>解决办法：</strong><br>新增个人公钥（部署公钥）</p>
<p>1.如何生成ssh公钥<br>你可以按如下命令来生成sshkey:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">ssh-keygen -t rsa -C &quot;xxxxx@xxxxx.com&quot;  </div><div class="line"></div><div class="line"># Generating public/private rsa key pair...</div><div class="line"># 三次回车即可生成 ssh key</div></pre></td></tr></table></figure></p>
<p>查看你的public key，并把他添加到 Git @ OSC SSH key添加地址<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cat ~/.ssh/id_rsa.pub</div><div class="line"># ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....</div></pre></td></tr></table></figure></p>
<p>添加后，在终端（Terminal）中输入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ssh -T git@git.oschina.net</div></pre></td></tr></table></figure></p>
<p>若返回<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Welcome to Git@OSC, yourname!</div></pre></td></tr></table></figure></p>
<p>则证明添加成功。        </p>
<p>2.怎么添加用户ssh key?</p>
<ol>
<li>点击右上角的输入图片说明标志,进入个人中心,然后点击左侧的ssh公钥后在下图位置填写你的ssh公钥</li>
<li>点击确定,然后验证密码(即你的注册账号密码)就完成了ssh公钥添加<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="https://static.oschina.net/uploads/img/201610/18115822_miTO.png" alt="这里写图片描述" title="">
                </div>
                <div class="image-caption">这里写图片描述</div>
            </figure>
</li>
</ol>
<p>3.项目的ssh key和用户的ssh key两处地方有什么不同?</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">项目的sshkey只针对项目,且我们仅对项目提供了部署公钥,即项目下的公钥仅能拉取项目,这通常用于生产服务器拉取仓库的代码。</div><div class="line">而用户的key则是针对用户的,用户添加了key就对用户名下的项目和用户参加了的项目具有权限,一般而言,用户的key具有推送和拉取的权限,而项目的key则只具有拉取权限</div></pre></td></tr></table></figure>
        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-05-22T03:09:47.767Z" itemprop="dateUpdated">2017年5月22日 11:09</time>
</span><br>


        这里写留言或版权声明：<a href="/2017/03/03/hexo-deploy发布失败解决办法/" target="_blank" rel="external">weiyonghua&#39;s Blog/2017/03/03/hexo-deploy发布失败解决办法/</a>
    </div>
    <footer>
        <a href="weiyonghua's Blog">
            <img src="/img/avatar.jpg" alt="weiyonghua">
            weiyonghua
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/deploy/">deploy</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo/">hexo</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&title=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&pic=weiyonghua's Blog/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&title=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&source=YOUR_DESC" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&via=weiyonghua's Blog" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/03/10/jvm系列-八-jvm知识点总览-高级Java工程师面试必备/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">jvm系列(八):jvm知识点总览-高级Java工程师面试必备</h4>
      </a>
    </div>
  

  
</nav>



    

<div class="comments" id="comments">
    <div class="ds-thread" data-thread-key="hexo-deploy发布失败解决办法" data-title="hexo deploy发布失败解决办法" data-url="weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/"></div>
</div>
<script>
lazyScripts.push('//cdn.bootcss.com/marked/0.3.6/marked.min.js');

var duoshuoQuery = {short_name:'ysblog', theme: 'none'};
lazyScripts.push('/js/embed.min.js?v=1.4.9');


</script>







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢大爷~
        <i class="icon icon-quote-right"></i>
    </h3>
    <ul class="reward-items">
        
        <li>
            <img src="/img/wechat.jpg" title="微信打赏二维码" alt="微信打赏二维码">
            <p>微信</p>
        </li>
        

        
        <li>
            <img src="/img/alipay.jpg" title="支付宝打赏二维码" alt="支付宝打赏二维码">
            <p>支付宝</p>
        </li>
        
    </ul>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            <span>博客内容遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p>
            <span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a></span>
            <span>weiyonghua's Blog &copy; 2015 - 2017</span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&title=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&pic=weiyonghua's Blog/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&title=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&source=YOUR_DESC" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《hexo deploy发布失败解决办法》 — weiyonghua's Blog&url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/&via=weiyonghua's Blog" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=weiyonghua's Blog/2017/03/03/hexo-deploy发布失败解决办法/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };



</script>

<script src="/js/main.min.js?v=1.4.9"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.4.9" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>


</body>
</html>
